import React from "react";
import Stu from './Stu';

//声明一个类式组件
export default class App extends React.Component {
  render() {
    //声明变量
    let data = [{
      name: "王帅",
      age: 19,
      hobby: ["唱歌", "跳舞", "篮球", "music"],
    },{
      name: "雯静",
      age: 18,
      hobby: ["看书", "写字", "画画"],
    },{
      name: "丁豪",
      age: 20,
      hobby: ["游戏", "跑步"],
    },{
      name: "苗苗",
      age: 18,
      hobby: ["写字", "看书", '画画'],
    }]

    return <div>
      <h2>学员列表</h2>
      <hr />
      {
        data.map((item, index) => {
          return <Stu key={index} {...item} />
        })
      }
    </div>;
  }
}


